package it.koutifaris.travianmap.view.serversview;

import it.koutifaris.travianmap.command.Command;
import it.koutifaris.travianmap.context.HasApplicationContex;
import it.koutifaris.travianmap.dal.TravianServerService;
import it.koutifaris.travianmap.dal.TravianServerService.TravianServer;

public class OnDeleteCommand extends HasApplicationContex implements Command {

	private final TravianServer travianServer;

	public OnDeleteCommand(TravianServerService.TravianServer travianServer) {
		this.travianServer = travianServer;
	}

	@Override
	public void execute() {
		getTravianMapContext().getDeleteService().deleteServer(travianServer);
		new ServersViewController().show();
	}
}
